#########################
#   Author : Leon yu    #
#   Date : 2025/06/04   #
#   Id : SM2772         #
#########################
from datetime import datetime
from dbResps.querySalesItemReport import *
from apiRespsAnalyze.queryDiscountDetailResultFromApi import *
from compareResult.compareUtils import Compare
from dbResps.queryDiscountDetailReport import *

# 非当天 6/12号
# startTime = 1717520400000
# endTime = 1717606799000

startTime = 1717434000000
endTime = 1717606799000

getQueryDiscountDetailResultFromApi_Result = queryDiscountDetailResult(startTime, endTime)  # 毛利率不知道怎么取，暂忽略
getQueryDiscountDetailReportFromDB_Result = getQueryDiscountDetailReportFromDB(startTime, endTime)
# print(getQueryDiscountDetailResultFromApi_Result)

if __name__ == "__main__":
    compareResult = Compare.compare(getQueryDiscountDetailResultFromApi_Result, getQueryDiscountDetailReportFromDB_Result)
    if compareResult:
        print('compare success')
    else:
        print('compare fail')
        print(getQueryDiscountDetailReportFromDB_Result)
        print(getQueryDiscountDetailResultFromApi_Result)